import { Component, Input, EventEmitter, Output, OnInit } from '@angular/core';
import { UserComponent } from '../app.usercomponent';
import { HttpClient } from '@angular/common/http';
import { Observable, of } from 'rxjs';
import { ActiveTitleService } from '../../../services/active-title.service';
import { GetUserService } from '../../../services/getUser.service';

class Customer {
  id: number;
  name: string;
  email: string;
  tel: string;
}

@Component({
  selector: 'app-nz-demo-card-basic',
  templateUrl: './app.child.html',
  styles  : [
      `p {
      margin: 0;
    }`
  ]
})
export class NzDemoCardBasicComponent implements OnInit {
  @Input() title = '';
  customersObservable: Observable<any>;
  @Output()
  getMoreEvent = new EventEmitter<string>();
  constructor(private activeTitleService: ActiveTitleService, private getUserService: GetUserService) {}
  getMore() {
    console.log('获取更多');
    this.getMoreEvent.emit('发射载荷');
    // this.activeTitleService.reqApi().subscribe(data => { console.log(data) }, err => { console.log(err) })
  }
  ngOnInit() {
      // console.log(this.activeTitleService);
     this.activeTitleService.reqApi('/template_type').subscribe(data => { console.log(data); }, err => { console.log(err); });
     this.getUserService.getUser().subscribe(data => { console.log(data); }, err => { console.log(err); });
  }
}
